<template>
	<div>
		<el-container>
			<el-card>
				<!-- 面包屑导航区域 -->
				<el-breadcrumb separator-class="el-icon-arrow-right">
					<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
					<el-breadcrumb-item>客户系统</el-breadcrumb-item>
					<el-breadcrumb-item>我的学生</el-breadcrumb-item>
				</el-breadcrumb>
				<el-form :inline="true" :model="formInline" class="demo-form-inline">
					<el-form-item label="学生姓名:">
						<el-input v-model="formInline.Name" placeholder="请输入学生姓名" clearable></el-input>
					</el-form-item>
					<el-form-item label="电话:">
						<el-input v-model="formInline.Phone" placeholder="请输入电话" clearable></el-input>
					</el-form-item>
					<el-form-item label="创建时间:">
						<el-date-picker v-model="formInline.CreateTimeStart" type="date" placeholder="选择日期" clearable>
						</el-date-picker>
					</el-form-item>
					<el-form-item label="-">
						<el-date-picker v-model="formInline.CreateTimeEnd" type="date" placeholder="选择日期" clearable>
						</el-date-picker>
					</el-form-item>
					<el-form-item label="QQ:">
						<el-input v-model="formInline.QQ" placeholder="请输入QQ" clearable></el-input>
					</el-form-item>
					<el-form-item label="咨询师">
						<el-select v-model="formInline.AskerId" clearable>
							<el-option label="请选择" value=""></el-option>
							<el-option v-for="item in pageUserlist" :label="item.LoginName" :value="item.Id">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="是否支付:">
						<el-select v-model="formInline.IsPay" clearable>
							<el-option label="--全部--" value=""></el-option>
							<el-option label="是" value="是">是</el-option>
							<el-option label="否" value="否">否</el-option>
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="是否有效:">
						<el-select v-model="formInline.IsValid" clearable>
							<el-option label="--请选择--" value=""></el-option>
							<el-option label="是" value="是">是</el-option>
							<el-option label="否" value="否">否</el-option>
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="是否回访:">
						<el-select v-model="formInline.IsReturnVist" clearable>
							<el-option label="--请选择--" value=""></el-option>
							<el-option label="是" value="是">是</el-option>
							<el-option label="否" value="否">否</el-option>
							</el-option>
						</el-select>
					</el-form-item>

					<el-form-item>
						<el-button type="primary" @click="onSubmit">查询</el-button>
					</el-form-item>
				</el-form>
					<el-button type="success" @click="exportExcel">导出Excel</el-button>
					<!--  <el-main> -->
					<el-table :data="tableData" id="out-table" border tooltip-effect="dark" highlight-current-row @header-contextmenu="contextmenu"
					 style="width: 100%">
						<el-table-column fixed="left" type="selection">
						</el-table-column>
						<el-table-column fixed="left" prop="Id" label="序号">
						</el-table-column>
						<el-table-column fixed="left" prop="Name" label="学生姓名">
						</el-table-column>
						<el-table-column v-for="(item,index) in tableHeader" v-if="colData[index].istrue" :key="item.key"
						 show-overflow-tooltip :label="item.label" :prop="item.key">
							<template slot-scope="scope">
								<span v-if="(item.key==='qyrq'||item.key==='ccrq'||item.key==='zcsj')&&scope.row[item.key]">{{ scope.row.qyrq|parseTime() }}</span>
								<span v-else>{{ scope.row[item.key] }} </span>
							</template>
						</el-table-column>
						<el-table-column fixed="right" label="操作" width="450px">
							<template slot-scope="scope">
								<el-button @click="LookhandleClick(scope.row)" type="primary" icon="el-icon-search" size="small">查看
								</el-button>
								<el-button @click="EdithandleClick(scope.row)" type="success" icon="el-icon-edit" size="small">
									编辑
								</el-button>
								<el-button @click="TrackhandleClick(scope.row)" type="warning" icon="el-icon-place" size="small">跟踪
								</el-button>
								<el-button @click="DelhandleClick(scope.row.Id)" type="danger" icon="el-icon-delete" size="small">删除
								</el-button>
								<el-button @click="JournalhandleClick(scope.row)" type="primary" icon="el-icon-tickets" size="small">日志
								</el-button>
							</template>
						</el-table-column>
					</el-table>
					<div v-show="menuVisible" :style="{top:top+ &quot;px&quot;,left:left+ &quot;px&quot;}" class="menu1">
						<el-checkbox-group v-model="colOptions">
							<el-checkbox v-for="(item,index) in colSelect" v-model="colData[index].istrue" :key="item" :label="item" />
						</el-checkbox-group>
					</div>
					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background :current-page="page"
					 :page-sizes="[5, 10, 15]" :page-size="limit" layout="total, sizes, prev, pager, next, jumper" :total="count">
					</el-pagination>
			</el-card>
			<!-- dialog查看对话框区域 -->
			<el-dialog title="查看所有" :visible.sync="LookdialogFormVisible">
				<el-form :model="Lookform" :inline="true" label-position="right">
					<el-form-item label="姓名">
						<el-input disabled v-model="Lookform.Name" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="性别">
						<el-input disabled v-model="Lookform.Sex" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="年龄">
						<el-input disabled v-model="Lookform.Age" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="电话">
						<el-input disabled v-model="Lookform.Phone" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="学历">
						<el-input disabled v-model="Lookform.StuStatus" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="个人状态">
						<el-input disabled v-model="Lookform.PerState" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="QQ">
						<el-input disabled v-model="Lookform.QQ" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="微信">
						<el-input disabled v-model="Lookform.Weixin" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="是否访问:">
						<el-switch disabled v-model="Lookform.IsValid" active-color="#13ce66" active-value="是" inactive-value="否"
						 active-text="是" inactive-text="否"></el-switch>
					</el-form-item>
					<el-form-item label="是否回访">
						<el-switch disabled v-model="Lookform.IsReturnVist" active-color="#13ce66" active-value="是" inactive-value="否"
						 active-text="是" inactive-text="否"></el-switch>
					</el-form-item>
					<el-form-item label="是否上门">
						<el-switch disabled v-model="Lookform.IsHome" active-color="#13ce66" active-value="是" inactive-value="否"
						 active-text="是" inactive-text="否"></el-switch>
					</el-form-item>
					<el-form-item label="是否支付">
						<el-switch disabled v-model="Lookform.lsPay" active-color="#13ce66" active-value="是" inactive-value="否"
						 active-text="是" inactive-text="否"></el-switch>
					</el-form-item>
					<el-form-item label="金额">
						<el-input disabled v-model="Lookform.Money" autocomplete="off"></el-input>
					</el-form-item>
				</el-form>
			</el-dialog>
			<!-- 添加 -->
			<el-dialog title="添加学生" :visible.sync="dialogAddFormVisible" @close="adddialogclosed">
				<el-form :model="addform" ref="addFormRef" :rules="addrules">
					<el-form-item label="学生姓名" prop="Name" :label-width="formLabelWidth">
						<el-input v-model="addform.Name" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="性别" prop="Sex" :label-width="formLabelWidth">
						<el-radio-group v-model="addform.Sex">
							<el-radio label="男"></el-radio>
							<el-radio label="女"></el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="年龄" prop="Age" :label-width="formLabelWidth">
						<el-input v-model="addform.Age" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="手机号" prop="Phone" :label-width="formLabelWidth">
						<el-input v-model="addform.Phone" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="状态" prop="StuStatus" :label-width="formLabelWidth">
						<el-input v-model="addform.StuStatus" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="学历" prop="PerState" :label-width="formLabelWidth">
						<el-input v-model="addform.PerState" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="QQ" prop="QQ" :label-width="formLabelWidth">
						<el-input v-model="addform.QQ" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="微信" prop="Weixin" :label-width="formLabelWidth">
						<el-input v-model="addform.Weixin" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="咨询师名称" :label-width="formLabelWidth">
						<el-select v-model="addform.AskerId" placeholder="请选择咨询师">
							<el-option v-for="item in pageUserlist" :label="item.LoginName" :value="item.Id" :key="item.Id">
							</el-option>
						</el-select>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogAddFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="addUser">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 编辑对话框 -->
			<el-dialog title="编辑学生信息" :visible.sync="EditdialogFormVisible" width="50%">
				<el-form :model="form" ref="ruleForm" :inline="true" label-position="right" label-width="80px">
					<!-- <el-row> -->
					<!-- <el-col :span="11"> -->
					<el-form-item label="姓名">
						<el-input v-model="form.Name" autocomplete="off"></el-input>
					</el-form-item>
					<!-- </el-col> -->
					<!-- <el-col :span="11"> -->
					<el-form-item label="性别">
						<el-radio-group v-model="form.Sex">
							<el-radio label="男"></el-radio>
							<el-radio label="女"></el-radio>
						</el-radio-group>
					</el-form-item>
					<!--  </el-col> -->
					<el-form-item label="年龄">
						<el-input v-model="form.Age" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="电话">
						<el-input v-model="form.Phone" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="学历">
						<el-input v-model="form.StuStatus" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="个人状态">
						<el-input v-model="form.PerState" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="QQ">
						<el-input v-model="form.QQ" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="微信">
						<el-input v-model="form.Weixin" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="金额">
						<el-input v-model="form.Money" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="是否有效:">
						<el-switch v-model="form.IsValid" active-color="#13ce66" active-value="是" inactive-value="否" active-text="是"
						 inactive-text="否">
						</el-switch>
					</el-form-item>
					<el-form-item label="是否回访">
						<el-switch v-model="form.IsReturnVist" active-color="#13ce66" active-value="是" inactive-value="否" active-text="是"
						 inactive-text="否">
						</el-switch>
					</el-form-item>
					<el-form-item label="是否上门">
						<el-switch v-model="form.IsHome" active-color="#13ce66" active-value="是" inactive-value="否" active-text="是"
						 inactive-text="否">
						</el-switch>
					</el-form-item>
					<el-form-item label="是否支付">
						<el-switch v-model="form.IsPay" active-color="#13ce66" active-value="是" inactive-value="否" active-text="是"
						 inactive-text="否">
						</el-switch>
					</el-form-item>

				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="EditdialogFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="editset">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 跟踪对话框 -->
			<el-dialog title="跟踪学生" :visible.sync="dialogGenFormVisible" @close="Gendialogclosed">
				<el-form :model="followForm" ref="GenFormRef">					
					<el-form-item label="访问类型" :label-width="formLabelWidth">
						<el-select v-model="followForm.FollowType" placeholder="选择">
							<el-option label="面谈" value="面谈"></el-option>
							<el-option label="家访" value="家访"></el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="访问时间" :label-width="formLabelWidth">
						<el-date-picker v-model="followForm.FollowTime" type="datetime" placeholder="选择日期">
						</el-date-picker>
					</el-form-item>
					<el-form-item label="内容" :label-width="formLabelWidth">
						<el-input v-model="followForm.Content1" auto-complete="off"></el-input>
					</el-form-item>
					<el-form-item label="下次跟踪时间" :label-width="formLabelWidth">
						<el-date-picker v-model="followForm.NextFollowTime" type="datetime" placeholder="选择日期">
						</el-date-picker>
					</el-form-item>				
					<el-form-item label="访问状态" :label-width="formLabelWidth">
						<el-switch v-model="followForm.FollowState" active-color="#13ce66" active-value="是" inactive-value="否" active-text="是"
						 inactive-text="否"></el-switch>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogGenFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="submitCheckEdit">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 日志弹出框 -->
			<el-dialog title="日志" :visible.sync="logdialogFormVisible" >
			  <el-form :model="logform">
			    <el-form-item label="学生名称" :label-width="formLabelWidth">
			      <el-input v-model="logform.StudentName" autocomplete="off"></el-input>
			    </el-form-item>
				<el-form-item label="跟踪时间" :label-width="formLabelWidth">
				  <el-input v-model="logform.FollowTime" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="内容" :label-width="formLabelWidth">
				  <el-input v-model="logform.Content1" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="下次跟踪时间" :label-width="formLabelWidth">
				  <el-input v-model="logform.NextFollowTime" autocomplete="off"></el-input>
				</el-form-item>			    
			  </el-form>			  
			</el-dialog>
			<!-- </el-main> -->
		</el-container>
	</div>
</template>

<script>
	import FileSaver from "file-saver";
	import XLSX from "xlsx";
	export default {
		data() {
			return {
				// 角色数据数据
				pageUserlist: [],
				formInline: {
					Name: '',
					Phone: '',
					QQ: '',
					AskerId: '',
					CreateTimeStart: '',
					CreateTimeEnd: '',
					IsPay: '',
					IsValid: '',
					IsReturnVist: ''
				},
				LookdialogFormVisible: false,
				logdialogFormVisible:false,
				Lookform: {},
				askvisible: false,
				dialogAddFormVisible: false,
				addform: {},
				addFormRef: {
					Name: '',
					Age: '',
					Phone: '',
					Sex: ''
				},
				addrules: {
					Name: [{
						required: true,
						message: '请输入学生姓名',
						trigger: 'blur'
					}],
					Age: [{
						required: true,
						message: '年龄不能为空'
					}],
					Phone: [{
						required: true,
						message: '请输入手机号',
						trigger: 'blur'
					}],
					Sex: [{
						required: true,
						message: '请选择性别',
						trigger: 'change'
					}],
				},
				dialogGenFormVisible: false,
				EditdialogFormVisible: false,
				form: {},
				formLabelWidth: '120px',
				tableData: [],
				page: 1,
				limit: 5,
				count: 0,
				value: "",
				menuVisible: false, //右键菜单的显示与隐藏
				top: 0, //右键菜单的位置
				left: 0,
				logform:{},
				followForm:{StudentId:'',StudentName:'',FollowTime:'',NextFollowTime:'',Content1:'',UserId:'',FollowType:'',FollowState:''},
				colOptions: ['性别', '年龄', '电话', '学历', '个人状态',
					'所在区域', '咨询师姓名', '内容', 'QQ', '微信', '是否访问', '是否回访',
					'首次访问时间', '是否上门', '上门时间', '是否支付', '支付时间', '金额'
				],
				//多选框的选择项
				colSelect: ['性别', '年龄', '电话', '学历', '个人状态',
					'所在区域', '咨询师姓名', '内容', 'QQ', '微信', '是否访问', '是否回访',
					'首次访问时间', '是否上门', '上门时间', '是否支付', '支付时间', '金额'
				],
				//多选框已选择的内容，即表格中显示的列
				// istrue属性存放列的状态
				colData: [{
						title: '性别',
						istrue: true
					},
					{
						title: '年龄',
						istrue: true
					},
					{
						title: '电话',
						istrue: true
					},
					{
						title: '学历',
						istrue: true
					},
					{
						title: '个人状态',
						istrue: true
					},
					{
						title: '所在区域',
						istrue: true
					},
					{
						title: '咨询师姓名',
						istrue: true
					},
					{
						title: '内容',
						istrue: true
					},
					{
						title: 'QQ',
						istrue: true
					},
					{
						title: '微信',
						istrue: true
					},
					{
						title: '是否访问',
						istrue: true
					},
					{
						title: '是否回访',
						istrue: true
					},
					{
						title: '首次访问时间',
						istrue: true
					},
					{
						title: '是否上门',
						istrue: true
					},
					{
						title: '上门时间',
						istrue: true
					},
					{
						title: '是否支付',
						istrue: true
					},
					{
						title: '支付时间',
						istrue: true
					},
					{
						title: '金额',
						istrue: true
					}
				],
				tableHeader: [{
						label: '性别',
						key: 'Sex'
					},
					{
						label: '年龄',
						key: 'Age'
					},
					{
						label: '电话',
						key: 'Phone'
					},
					{
						label: '学历',
						key: 'StuStatus'
					},
					{
						label: '个人状态',
						key: 'PerState'
					},
					{
						label: '所在区域',
						key: 'Addres'
					},
					{
						label: '咨询师姓名',
						key: 'ZiXunName'
					},
					{
						label: '内容',
						key: 'Contenta'
					},
					{
						label: 'QQ',
						key: 'QQ'
					},
					{
						label: '微信',
						key: 'Weixin'
					},
					{
						label: '是否访问',
						key: 'IsValid'
					},
					{
						label: '是否回访',
						key: 'IsReturnVist'
					},
					{
						label: '首次访问时间',
						key: 'FirstVistitTime'
					},
					{
						label: '是否上门',
						key: 'IsHome'
					},
					{
						label: '上门时间',
						key: 'HomeTime'
					},
					{
						label: '是否支付',
						key: 'IsPay'
					},
					{
						label: '支付时间',
						key: 'PayTime'
					},
					{
						label: '金额',
						key: 'Money'
					},
				]
			}
		},
		watch: {
			colOptions(newVal, oldVal) {
				if (newVal) { //如果有值发生变化，即多选框的已选项变化
					var arr = this.colSelect.filter(i => newVal.indexOf(i) < 0) // 未选中
					this.colData.filter(i => {
						if (arr.indexOf(i.title) !== -1) {
							i.istrue = false
						} else {
							i.istrue = true
						}
					})
				}
			}
		},
		methods: {
			exportExcel() {
				let fix = document.querySelector('.el-table__fixed');
				let fix1 = document.querySelector('.el-table__fixed-right');
				let wb;
				if (fix) { //判断要导出的节点中是否有fixed的表格，如果有，转换excel时先将该dom移除，然后append回去
					wb = XLSX.utils.table_to_book(document.querySelector('#out-table').removeChild(fix));
					document.querySelector('#out-table').appendChild(fix);
				} else if (fix1) {
					wb = XLSX.utils.table_to_book(document.querySelector('#out-table').removeChild(fix1));
					document.querySelector('#out-table').appendChild(fix1);
				} else {
					wb = XLSX.utils.table_to_book(document.querySelector('#out-table'));
				}
				let wbout = XLSX.write(wb, {
					bookType: 'xlsx',
					bookSST: true,
					type: 'array'
				})
				try {
					FileSaver.saveAs(new Blob([wbout], {
						type: 'application/octet-stream'
					}), 'student.xlsx')
				} catch (e) {
					if (typeof console !== 'undefined') console.log(e, wbout)
				}
				return wbout
			},
			contextmenu(row, event) {
				//先把菜单关闭，目的是第二次或者第n次右键鼠标的时候 它默认的是true
				this.menuVisible = false
				// 显示菜单
				this.menuVisible = true
				console.log("youjian")
				window.event.returnValue = false //阻止浏览器自带的右键菜单弹出
				//给整个document绑定click监听事件， 左键单击任何位置执行foo方法
				document.addEventListener('click', this.foo)
				//event对应的是鼠标事件，找到鼠标点击位置的坐标，给菜单定位
				this.top = event.clientY
				this.left = event.clientX
			},
			foo() {
				this.menuVisible = false //关闭菜单栏
				document.removeEventListener('click', this.foo) //解绑click监听，很重要，具体原因可以看另外一篇博文
			},
			onSubmit() {
				this.GetStudentTable();
			},
			handleSizeChange(val) {
				this.limit = val;
				this.GetStudentTable();
			},
			handleCurrentChange(val) {
				this.page = val;
				this.GetStudentTable();
			},
			async getPagelist() {
				const {
					data: res
				} = await this.$http.get('/api/api/MyStu/GetPageList')
				this.pageUserlist = res.data;
			},
			async GetStudentTable() {
							const {
								data: res
							} = await this.$http.get('/api/api/MyStu/GetAllPage', {
								params: {
									Id:parseInt(window.sessionStorage.getItem('token')),
									page: this.page,
									limit: this.limit,
									Name: this.formInline.Name,
									Phone: this.formInline.Phone,						
									QQ: this.formInline.QQ,
									AskerId: this.formInline.AskerId,
									starttime: this.formInline.CreateTimeStart,
									endtime: this.formInline.CreateTimeEnd,
									IsPay: this.formInline.IsPay,
									IsValid: this.formInline.IsValid,
									IsReturnVist: this.formInline.IsReturnVist
								}
							})
							if(res.code==0){
								// console.log(res)
								this.count = res.count;
								this.tableData = res.data;					
							}else{
								this.$message.error(res.msg);
							}								
						},
			adddialogclosed() {
				this.$refs.addFormRef.resetFields();
			},
			//添加处理
			addUser() {
				this.$refs.addFormRef.validate(async valid => {
					if (!valid) return
					const {
						data: res
					} = await this.$http.post('/api/api/MyStu/AddStudent', this.addform)
					if (res.code == -1) {
						this.$message.error("添加失败！")
					} else {
						this.$message.success("添加成功！");
						this.dialogAddFormVisible = false;
						this.GetStudentTable();
					}
				})
			},
			//查看功能
			LookhandleClick(row) {
				this.LookdialogFormVisible = true;
				// console.log(row);
				this.Lookform = row;
			},
			EdithandleClick(row) {
				this.EditdialogFormVisible = true;
				this.form = row;
			},
			// 编辑功能
			async editset() {
				const {
					data: res
				} = await this.$http.post('/api/api/MyStu/EditStudent', this.form)
				if (res.data != 0) {
					this.$message.success("编辑成功！");
					this.form = {};
					this.EditdialogFormVisible = false;
					this.GetStudentTable();
				} else {
					this.$message.error("编辑失败！");
				}
			},
			Gendialogclosed() {
				this.$refs.GenFormRef.resetFields();
			},
			TrackhandleClick(row) {
				this.dialogGenFormVisible = true;
				this.followForm.StudentName=row.Name,
				this.followForm.StudentId=row.Id
				this.followForm.UserId=parseInt(window.sessionStorage.getItem('token'));
			},
			//追踪功能
			async submitCheckEdit() {
				const {
					data: res
				} = await this.$http.post('/api/api/MyStu/TrackStudent2', this.followForm);
				if (res.code !== 0) {
					this.$message.error(res.msg);
				} else {
					this.$message.success(res.msg);
					this.dialogGenFormVisible = false;
					this.GetStudentTable();
				}
			},	
			//日志功能
			async JournalhandleClick(row){
				this.logform.StudentId=row.Id
				console.log(row.Id)
				this.logdialogFormVisible=true
				const {
					data: res
				} = await this.$http.post('/api/api/MyStu/followStudent?Id='+row.Id);
				console.log(res.data)
				this.logform=res.data
			},
			async DelhandleClick(Id) {
				const confirmResult = await this.$confirm('此操作将永久删除用户, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					})
					//如果用户取消删除则 则打印cancel字符串
					.catch(err => err)
				//如果用户确认删除则confirmResult 为confim字符串

				if (confirmResult != 'confirm') {
					return this.$message.info("已经取消删除")
				}
				const {
					data: res
				} = await this.$http.post('/api/api/MyStu/DelStudent', {
					Id: Id
				})
				if (res.code != 0) {
					return this.$message.error("删除失败" + res.msg)
				}
				this.$message.success("删除成功")
				this.GetStudentTable();
			},
			split() {
				let row = this.tableData
				console.log(row);
				for (let i = 0; i < row.length; i++) {
					console.log(row[i].FirstVistitTime)
					row[i].CreateTime = row[i].CreateTime.replace(/T/, ' ')
					if (row[i] !== null) {
						row[i].FirstVistitTime = row[i].FirstVistitTime.replace(/T/, ' ')
					}
				}
				console.log(row);
				this.tableData = row;
			}
		},
		created: function() {
			this.GetStudentTable();
			this.getPagelist();
		}
	}
</script>

<style scoped>
	.menu1 {
		position: fixed;
		height: auto;
		width: 231px;
		border-radius: 3px;
		border: 1px solid #999999;
		background-color: #f4f4f4;
		padding: 10px;
		z-index: 1000
	}

	.el-checkbox {
		display: block;
		height: 20px;
		line-height: 20px;
		padding: 0 5px;
		margin-right: 0;
		font-size: 12px;
		border: 1px solid transparent;
	}

	.el-checkbox:hover {
		border-radius: 3px;
		border: 1px solid #999999;
	}
</style>
